package com.zmj.framework.ctrl;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.zmj.framework.base.BaseCtrl;
import com.zmj.framework.bean.Sysuser;
import com.zmj.framework.bean.UserSession;
import com.zmj.framework.service.SysuserManager;
@Controller
@RequestMapping("/main.do")
public class MainCtrl extends BaseCtrl {
	@RequestMapping(params = "method=main")
	public ModelAndView main(HttpServletRequest request, HttpServletResponse response) {
		UserSession userSession = (UserSession) request.getSession().getAttribute("userSession");
		if (userSession != null) {
			String yhmc=userSession.getSysuser().getYhmc();
			request.setAttribute("yhmc", yhmc);
		}
		return new ModelAndView("main");
	} 
	@RequestMapping(params = "method=menu")
	public ModelAndView menu(HttpServletRequest request, HttpServletResponse response) {
		return new ModelAndView("menu");
	}
	@RequestMapping(params = "method=header")
	public ModelAndView header(HttpServletRequest request, HttpServletResponse response) {
		return new ModelAndView("header");
	}
}